<!DOCTYPE html>
<html>
<head>
    <title>代理商列表</title>
    <#include "/header.html">
    <link type="text/css" rel="stylesheet" href="${request.contextPath}/statics/plugins/layui/css/layui.css">

    <style>
        th {
            text-align: center;
        }
    </style>
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
            <div>
                <div class="layui-inline" id="showflag" style="display: none;" v-show="this.deptId==1">
                    <select id="deptList" lay-verify="" class="layui-input layui-unselect" style="width: 180px">
                        <option value="0" selected="selected"> 请选择渠道</option>
                    </select>
                </div>

                <div class="layui-inline">
                    <input type="text" class="layui-input" v-model="q.agentId" @keyup.enter="query"
                           placeholder="请输入推荐码">
                </div>
                <div class="layui-inline">
                    <input type="text" class="layui-input" v-model="q.phone" @keyup.enter="query"
                           placeholder="请输入合伙人手机">
                </div>

                <div class="layui-inline">
                    <input type="text" class="layui-input" v-model="q.name" @keyup.enter="query"
                           placeholder="请输入合伙人姓名">
                </div>
                <div class="layui-inline">
                    <input type="text" class="layui-input" v-model="q.parentName" @keyup.enter="query"
                           placeholder="请输入推荐人">
                </div>
                <div class="layui-inline">
                    <select v-model="q.type" class="form-control">
                        <option v-for="type in this.types" :value="type.value">{{type.msg}}</option>
                    </select>
                </div>
                <div class="layui-inline" v-show="this.deptId==5">
                    <select v-model="q.standardState" class="form-control">
                        <option value="-1">请选择</option>
                        <option value="0">未达标</option>
                        <option value="1">合格</option>
                    </select>
                </div>
                <div class="layui-inline">
                    <select v-model="q.grade" class="form-control" >
                        <option v-for="lv in this.gradeList" :value="lv.lv">{{lv.lv==0?'请选择等级':lv.lv}}</option>
                    </select>
                </div>

                <a class="btn btn-default" @click="query">查询</a>
                <a class="btn btn-default" @click="down">下载</a>
                <input type="button" class="btn btn-default" @click="clean" value="刷新"/>
                <!--    <a class="btn btn-default" @click="insert">导入</a>-->
                </form>

            </div>
            <div style="height: 5px"></div>
            <table id="jqGrid"></table>
            <div id="jqGridPager"></div>
        </div>

    </div>

    <div v-show="showUpdate" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal">
            <input type="hidden" v-model="agent.pid"/>
            <div class="form-group">
                <div class="col-sm-2 control-label">用户名</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="agent.name"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">手机号码</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="agent.phone"/>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label">角色</div>
                <div class="col-sm-10">
                    <select v-model="agent.type" class="form-control">
                        <option value="2">普通</option>
                        <option value="3">盟主</option>
                    </select>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">等级</div>
                <div class="col-sm-10" style="position: relative;">
                    <select v-model="agent.thisGrade" class="form-control" >
                        <option v-for="lv in this.gradeList" :value="lv.lv">V{{lv.lv}}</option>
                    </select>
                    <label style="position: absolute;left:390px;bottom: 5px; width: 50px;">锁定</label><input type="checkbox" style="position: absolute;left:420px;bottom:12px;"  v-model="agent.locked" >
                </div>

            </div>
            <div class="form-group" v-show="agent.realName=='1'">
                <div class="col-sm-2 control-label">身份证号</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="agent.idCard" placeholder="请输入身份证号"/>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label">账户总余额</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="agent.totalAmount"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">可提取余额</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="agent.availableAmount"/>
                </div>
            </div>
           <div class="form-group" v-show="this.deptId==5">
                <div class="col-sm-2 control-label">冻结资金</div>
                <div class="col-sm-10">
                    <input type="text" class="form-control" v-model="agent.freeznAmount"/>
                </div>
            </div>

            <div class="form-group">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" @click="update" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="reload" value="返回"/>
            </div>
        </form>
    </div>
    <!-- 选择封禁类别 -->
    <div id="freezAgent" style="display: none;padding:10px;">
        <h3>请选择封禁类别</h3>
    </div>

    <div id="roleList" style="display: none;width: 300px;height: auto;margin: 5px">
        <table style="text-align: center;" cellspacing="2" cellpadding="0">
            <th>
                <tr>
                    <td>合伙人等级</td>
                    <td>终端种类</td>
                    <td>分润费率</td>
                    <td>交易是否Vip</td>
                </tr>
            </th>
            <tb>
                <tr v-for="rate in this.rateList" >
                    <td>V{{rate.lv}}</td>
                    <td>{{rate.terminalName}}</td>
                    <td>万{{rate.rate}}</td>
                    <td>{{rate.isVip}}</td>
                </tr>
            </tb>
        </table>
    </div>


    <div style="display: none;width: 400px;height: 400px" class="panel panel-default" id="verify">
        <form class="form-horizontal" style="width: 400px;height: 400px">
            <div class="form-group">
                <div class="col-sm-2 control-label">合伙人id</div>
                <div class="col-sm-5" style="width: 280px">
                    <input type="text" class="form-control" v-model="verify.agentId" readonly="readonly"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">身份证号码</div>
                <div class="col-sm-5" style="width: 280px">
                    <input type="text" class="form-control" v-model="verify.identity"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">银行名称</div>
                <div class="col-sm-5" style="width: 280px">
                    <input type="text" class="form-control" v-model="verify.bankName"/>
                </div>
            </div>
            <div class="form-group">
                <div class="col-sm-2 control-label">银行卡号</div>
                <div class="col-sm-5" style="width: 280px">
                    <input type="text" class="form-control" v-model="verify.bankNo"/>
                </div>
            </div>
        </form>
    </div>
</div>
<script src="${request.contextPath}/statics/js/modules/agent/agentInital.js?_${.now?long}"></script>
<script src="${request.contextPath}/statics/js/modules/agent/sysagent.js?_${.now?long}"></script>

</body>
</html>